package com.squirrel.michale.sort2;

import java.util.PriorityQueue;

/**
 * @author guanhao 观浩
 * @version 1.0.0.0
 * @createTime 2023/1/28 10:57 AM
 * @company Michale Squirrel
 * @link
 * @description
 */
public class HeapSort {


    public static void main(String[] args) {
        PriorityQueue<Integer> heap = new PriorityQueue<>();

        heap.add(5);
        heap.add(7);
        heap.add(3);
        heap.add(0);
        heap.add(2);
        heap.add(5);
        heap.add(9);

        while (!heap.isEmpty()) {
            System.out.println(heap.poll());
        }
    }
}
